Enhance Codec Iteration and Checking of HardwareConfigMethodFlags #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey
During intergration steps of hw decoding I see that some thing would be very handy.
1. Hardware Configuration Flag Check:
A method HasHardwareConfigMethodFlag in the Codec struct allows checking if a codec supports a specific hardware configuration method. This is particularly useful for identifying if a codec is hardware accelerated.
Implementation snippet:
2. Codec Iteration Enhancement:
A new function IterateCodecs simplifies the process of iterating over available codecs. This function takes a CodecProcessor and applies it to each codec, facilitating custom processing logic per codec.
Implementation snippet:
3. Codec Identification:
Added a method ID to the Codec struct to retrieve the codec's ID, aiding in the identification and filtering of codecs.
Use Case
These enhancements allow for efficient identification and selection of codecs based on capabilities and specific codec IDs. This is particularly useful in scenarios where an application needs to support multiple codecs across different operating systems and offers the user the ability to switch between different decoders.
A practical example of using these enhancements is shown below:
Br christoph